package com.hy.controller.login;


import com.hy.common.base.RespResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.RolesAllowed;
import java.util.Collection;


@RestController
public class LoginController {




    @RequestMapping("/hello")
    public RespResult test01(){


        Collection<? extends GrantedAuthority> authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities();
        authorities.forEach(e-> System.out.println("====="+e));
        return RespResult.success();
    }

    @RequestMapping("/heyun")
    public RespResult test02(){


        return RespResult.success();
    }



}
